/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.web30.bookmark;

import java.util.Formatter;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
 * @author xiazy
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "bookmark", propOrder = {
    "id",
    "title",
    "url",
    "author",
    "content"
})
public class Bookmark {
    @XmlElement(required = true)
    protected String title;

    @XmlElement(required = true)
    protected String url;

    @XmlElement(required = true)
    protected String author;

    @XmlElement(required = true)
    protected String content;

    @XmlElement(required = false)
    protected String id;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }
    
    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @Override
    public String toString(){
        return (new Formatter()).format(
                "{\"title\":\"%s\", \"url\":\"%s\",\"author\":\"%s\",\"content\":%d\",\"id\":\"%s\"}",
                this.title, this.url,this.author,this.content,this.id).toString();
    }
}
